<?php
$db_team = pc_base::load_model('team_model');
$db_people = pc_base::load_model('people_model');
$db_member = pc_base::load_model('member_model');
pc_base::load_sys_class('exp');
?>
{template "content","header"}

{pc:get sql="select * from phpcms_commit where status=1 and a_catid=$catid and a_id=$id order by id desc" num="100" return="all_commit"}{/pc}
<script type="text/javascript" src="{JS_PATH2}commit.gaojian.js?ver={VERSION}"></script>

<!-- header -->
<header class="header bg2 clearfix">
<h3 class="fl"><a href="{get_ref(APP_PATH)}" title="返回上一级"><img src="{IMG_PATH2}icon/back.png" alt="返回上一级"></a></h3>
<span class="con">{$title}</span>
</header>
<!-- / header -->
<div class="h_48"></div>

<!-- main -->
<main class="main">
<div class="tIntroduction clearfix">
	<img src="{$thumb}" class="fl img2">
	<div class="con17">
		<div class="t10">
			<span>{$title}</span><!-- <i class="icon_rz"></i> -->
			<a href="javascript:void(0);" class="my_atten teacher js_like fr" data-catid="{$catid}" data-id="{$id}"></a>
		</div>
		<div class="tt10 line_height1"><span>{$titlename}</span></div>
		
		<div class="dengji_level fl " id="bgwhite2">
			<div class="num clearfix">
				<em class="blue">LV.{php echo exp::lv($exp,'teacher')}</em>
				<span>{php echo exp::cn($exp,'teacher')}</span>
			</div>
			<div class="progressbar1"><span style="width:{php echo 20 * exp::lv($exp,'teacher')}%;"></span></div>
		</div>
	</div>
</div>

<script src="{JS_PATH2}tab.js"></script>
<script type="text/javascript">
$(function() {
	var _t_idx = location.hash == '#commit' ? 2 : 0;
	console.log(_t_idx);
	$(".content").all_tab({
		defaultIndex: _t_idx,
		effect: "fade",
		trigger: "click",
		delayTime: 10
	});
});
</script>
<div class="content">
	<ul class="nav_course1 tab  clearfix">
		<li><a href="javascript:;">传授课程</a></li>
		<li><a href="javascript:;">讲师介绍</a></li>
		<li><a href="javascript:;">评价（<?=count($all_commit)?>）</a></li>
	</ul>
	<ul class="oListclass tab_con">
{pc:get sql="select * from phpcms_classmany where status=99 and catid=1 and one_teacher=$id order by id desc"}
{loop $data $c_one}
{php $team=$db_team->pkhs($c_one[one_team])}
{php $teacher=$db_people->pkhs($c_one[one_teacher])}
		<li><a href="{$c_one[url]}">
			<div class="oListclasstime">
				<span class="time1 fl">{date('Y-m-d',$c_one[class_time1])}</span>
				<span class="peo fr">{$c_one[num_view]}</span>
			</div>
			<div class="oListclasscon clearfix">
				<div class="pic1 fl"><img src="{$c_one[thumb]}"><em>席位：{$c_one[student_limit]}</em></div>
				<div class="oListclasscon_rg">
					<div class="oListclasscon_rg_t">{$c_one[title]}</div>
					<div class="oListclasscon_rg_name">{$team[title]}<i class="icon_v"></i></div>
					<div class="oListclasscon_rg_teacher clearfix">
						<span class="fl">讲师：{$teacher[title]}</span>
						<div class="oListclasscon_rg_teacher_price fr"><em>{price2cn($c_one[price_base])}</em>
							{if $c_one[price_cut]}
								<i>￥{price2cn($c_one[price_cut])}</i>
							{else}
								<i class="free">免费</i>
							{/if}
						</div>
					</div>
				</div>
			</div>
		</a></li>
{/loop}
{/pc}
	</ul>
	<div class="tab_con teacherDetail">{$content}</div>

	<div class="commit-list tab_con bgwhite padding10">
		<div class="teacherEvaluation_t clearfix">
			<div class="teacherEvaluation_t_lf fl">课程评价：<?=star2html($all_commit)?></div>
			<div class="teacherEvaluation_t_num fr">共有<em><?=count($all_commit)?></em>人评分</div>
		</div>
		<div class="myEvaluation clearfix">
			<img src="{IMG_PATH2}icon/peoBg.jpg" class="fl"> 
			<textarea readonly id="myEva">我要评论......</textarea>
		</div>
		<ul class="teacherEvaluation">
{loop $all_commit $one_commit}
{php $user=$db_member->pkhs($one_commit[uid],'userid')}
			<li>
				<div class="photo clearfix">
					<img class="fl" src="{$user[thumb]}">{$user[realname]}
					<div class="teacherEvaluation_t_lf fr"><?=star2html($one_commit['star'])?></div>
				</div>
				<div class="teacherEvaluation1">
					{$one_commit[content]}
					<em>{$one_commit[ymdhis]}</em>
				</div>
			</li>
{/loop}
		</ul>
	</div>
</div>
</main>
<!-- / main -->

<!-- 评价弹窗 -->
<div class="js-commit" style="display:none">
<div class="js-commit-bak"></div>
<div class="js-commit-body">
<div class="margin2">
	<div class="js-commit-star">我要评价：<span class="star5" data-catid="{$catid}" data-id="{$id}" data-star="5"></span></div>
	<textarea></textarea>
</div>
<div class="btn_tijiao clearfix">
	<div class="btn_tijiao_lf fl">
		每日第一次评论可获得 <em>30</em> 学分
		<span><i></i>学分说明</span>
	</div>
	<input type="submit" value="提交评论" id="js-commmit-send" >
</div>
</div>
</div>

{template "content","footer"}